<?php
namespace app\run\model;

use think\Model;
use think\Db;
class Config extends Model{
	//查询所属车系名称
	public static function sel_goods_name($gid){
		 return Db::name('product')->alias('a')
		 ->join('product_config b','a.id=b.goods_id')
		 ->field('a.id,a.name,b.*')
		 ->where('a.id',$gid)->find();
		
	}
	//查询name车系名
	public static function sel_goods_config($gid){
		 return Db::name('product')->field('name')->where('id',$gid)->find();
		
	}
	//配置参数入库
	public static function config_add($data){
		 return Db::name('product_config')->insert($data);
		
	}
	//配置参数修改
	public static function config_modify($data,$id){
		 return Db::name('product_config')->where('goods_id',$id)->update($data);
		
	}
 
}